﻿using System.Windows.Controls;

namespace Gamey.UI
{
    /// <summary>
    /// Interaction logic for NesControl.xaml
    /// </summary>
    public partial class NesControl : UserControl, IGamesControl
    {
        GamesControlManager manager;

        public NesControl()
        {
            InitializeComponent();
            
            this.manager = new GamesControlManager(this, Emulator.Nestopia);
        }

        internal GamesControlManager Manager
        {
            get { return this.manager; }
        }

        public TextBox SearchTextBox
        {
            get { return this.searchTextBox; }
        }

        public DataGrid DataGrid
        {
            get { return this.dataGrid; }
        }

        public void LaunchSelectedGame()
        {
            this.manager.LaunchSelectedGame();
        }

        public void IndicateLoading()
        {
            this.statusLabel.Content = "Loading games...";
        }

        public void IndicateReady()
        {
            this.statusBar.Items.Remove(this.progressBarItem);
            this.statusLabel.Content = "Ready";
        }
    }
}
